﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Outdoors.Helpers.Foursquare
{
    public class FoursquareAPI
    {
        private static string ClientSecret { get; set; }
        private static string ClientId { get; set; }

        public static void Initialize()
        {
            ClientSecret = "EMKCQ0RK24RCMVTOKRAODCXTKPWELYA2SXASWCJT54SB52DF";

            ClientId = "55NK1SKJYLPIQYO1T4ILRHGNNSVMX1XDT1S2B0P12UWLNHW2";
        }

        public static string VenuesSearchUrl(double latitude, double longitude, string categories)
        {
            Initialize();
     
            string url = "https://api.foursquare.com/v2/venues/search?" +
                "ll={0},{1}" +
                "&client_id={2}" +
                "&client_secret={3}" +
                "&v=20140511" +
                "&radius=1000" +
                "&categoryId={4}";

            string baseUrl = string.Format(url, latitude, longitude, ClientId, ClientSecret, categories);
            baseUrl = baseUrl.Remove(baseUrl.Length - 1, 1);

            return baseUrl;
        }
    }
}
